<link rel="stylesheet" href="js/codemirror/codemirror.css">
<link rel="stylesheet" href="js/codemirror/custom-codemirror.css">
<script src="js/codemirror/codemirror.js"></script>
<script src="js/codemirror/xml.js"></script>
<script src="js/codemirror/javascript.js"></script>
<script src="js/codemirror/css.js"></script>
<script src="js/codemirror/htmlmixed.js"></script>

<script>
	setTimeout(function() {
		$('textarea[data-src]').each(function() {
			var _this = this,
				src = this.getAttribute('data-src');
			$.get(src, function(res) {
				_this.innerHTML = res.slice(res.indexOf('<body>') - 1, res.lastIndexOf('</body>') + 7);
				var editor = CodeMirror.fromTextArea(_this, {
					lineNumbers: true, //显示行号
					mode: "text/html",
					matchBrackets: true,
					readOnly: true, //只读
					lineWrapping: 'wrap', //长行文字换行
					theme: 'darcula', //皮肤
				});
			})
		});
	}, 100)
</script>